from urllib.parse import urlparse

def get_domain_suffix_using_urlparse(url):
    parsed_url = urlparse(url)
    domain = parsed_url.netloc
    suffix = domain.split('.')[-1] if domain else None
    return suffix


if __name__ == '__main__':
    url1 = "https://www.example.com/path/to/page"
    suffix1 = get_domain_suffix_using_urlparse(url1)
    print(suffix1)  # 输出：com

    url2 = "https://www.example.cn/path/to/page"
    suffix2 = get_domain_suffix_using_urlparse(url2)
    print(suffix2)  # 输出：cn
